<?php

namespace App\Modules\Admin\Services\Equipment;

use App\Modules\Admin\Entities\Equipment\DeviceWarrantyModel;
use App\Modules\Admin\Services\BaseService;

class DeviceWarrantyService extends BaseService
{
    public function __construct(DeviceWarrantyModel $apparatus)
    {
        $this->model = $apparatus;
        $this->with=['user_info'];
    }
    public function lists(array $params) : array
    {
        $params['where_callback'] = function ($query) use ($params) {
            $request = request();
            if (!empty($dict_type = $request->input('dictType', ''))) {
                $query->where('company_name',$dict_type);
            }
        };
        $params['order']='id';
        $params['order_sort']='desc';
        $lists = parent::lists($params);
        return $lists; // TODO: Change the autogenerated stub
    }
}
